<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta name="viewport"
        content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>患者_并发症</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/style.css" />
    <link rel="stylesheet" type="text/css" href="../css/aui.2.0.css" />
    <link rel="stylesheet" type="text/css" href="../css/BasicPatientInformation.css" />
</head>

<body>
    <main id="app">
        <div class="aui-padded-5" id="tab1-con">
            <div id="tab1-con4">
                <div class="aui-btn aui-btn-info add-cabin-info-btn"  style="left: 72%;" onclick="patientVitalSigns()"><span
                    class="aui-iconfont aui-icon-plus"></span>添加并发症</div>
                <div class="tab-index-4-list" id="PatientVitalSigns">
                   
                </div>
            </div>
        </div>
    </main>
</body>
<script src="../script/api.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/vue.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/jquery.min.js" charset="utf-8" type="text/javascript"></script>
<script src="../js/ToConfigure.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-toast.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-dialog.js" charset="utf-8" type="text/javascript"></script>
<script src="../script/aui-tab.js" charset="utf-8" type="text/javascript"></script>
<script type="text/javascript">
     var vm = null;
    apiready = function () {
        api.addEventListener({
            name: 'On_Site_Inspection'
        }, function (ret, err) {
            if (ret.value.state == 'no') {
                reloadPatient();
            }
        });
        //接收患者ID
        var F_ID = api.pageParam.F_ID;
        vm = new Vue({
            el: '#app',
            data: {
                F_ID: 0, //患者唯一标识
            },
            created() {
                //获取所属医院IP地址
                var Url_IP = ToConfigure_IP("Gorgeous");
                //定义toast提示框
                var toast = new auiToast();
                //清空页面
                $("#PatientVitalSigns").html("");
                //定义拼接患者治疗记录单标签
                var PatientVitalSigns = "";
                if (F_ID !== undefined && F_ID !== '') {
                    this.F_ID = F_ID;
                }

                //判断预约这ID不为空
                // if (this.F_ID !== null && this.F_ID !== '' && this.F_ID !== undefined) {
                    var JsParms = new Object();
                    JsParms.crTrId = this.F_ID;
                    //查询患者治疗记录
                    $.ajax({
                        url: Url_IP + '/dataanalysis/complicationsinformation/getComplicationsInformation',
                        type: 'post',
                        async: false,
                        contentType: "application/json",
                        dataType: "json",
                        data: JSON.stringify(JsParms),
                        success: function (result) {
                            /**
                             * 验证返回信息是否为空
                             */
                            if (result.length > 0) {
                                /**
                                 *  循环object
                                 */
                                $.each(result, function (i, o) {
                                    // PatientVitalSigns += " <h2>次数：" + (i + 1) + "</h2>";
                                    PatientVitalSigns += "<p>"
                                    PatientVitalSigns += "<div><span>门诊号/住院号:" + o.tr_patient_no  + "</span><span>姓名：" + o.ai_name  + "</span><span>病种：" + o.cr_disease_type  + "</span></div>";
                                    PatientVitalSigns += "<div><span>描述:" + o.cr_describe  + "</span></div>";
                                    PatientVitalSigns += "</p>"
                                    PatientVitalSigns += "<br/><div style=\"border-bottom:1px #dddddd solid\"></div>"
                                })
                                if (PatientVitalSigns != "" && PatientVitalSigns != null) {
                                    $("#PatientVitalSigns").html(PatientVitalSigns);
                                } else {
                                    $("#PatientVitalSigns").html("");
                                }
                            } else {
                                /**
                                 *  弹窗提示 暂无相关信息
                                 */
                                toast.fail({
                                    title: "加载失败",
                                    duration: 2000
                                });
                            }
                        },
                        error: function (result) {
                            /**
                             *  提示错误信息
                             */
                            toast.fail({
                                title: "加载失败",
                                duration: 2000
                            });
                        }
                    });
                }

            // }
        });
    }
    /**
     *  
     * 并发症
     * */
    function patientVitalSigns() {
        api.openWin({
            name: 'complication_frame',
            url: './complication_frame.html',
            pageParam: {
              name: 'complication_frame',
                F_ID:api.pageParam.F_ID,
                userName:api.pageParam["userName"]
          },
        });
    }

    function reloadPatient() {
        window.location.reload();
    }
</script>
</html>